<h2>Reserve Loan</h2>
<div class="errorval"><?php echo validation_errors(); ?>
<?php echo $error; ?></div>
<!-- Loan information -->
<p>To Reserve an item, enter the Title or Accession number into the fields below.</p>
<p>NB: Item must be on loan for it to be reserved.</p>
<center>
<table>
<tr>
	<th align="right" width=30%>Accession Number:</th>
	<td><?php echo form_input('access_id', set_value('access_id')); ?></td>
	<td width="10%"><?php echo form_button('access_id_search', 'Search');?></td>
</tr>
<tr>
	<th align="right">(or) Title:</th>
	<td><?php echo form_input('title', set_value('title')); ?></td>
	<td width="10%"><?php echo form_button('title_search', 'Search');?></td>
</tr>
<tr>
	<td colspan="3">
		<p name="item">Please enter an accession number or title.</p>
	</td>
</tr>
</table>

</center>

<script type="text/javascript">
$(document).ready(function() {
		addAutocomplete('[name="title"]', '<?php echo site_url('admin/jquery/autocomplete/tbl_volume/title'); ?>');
	
		$("[name=access_id_search]").click( function(){
			$.post('<?php echo site_url('staff/jquery/getItemDetailsForReserveLoan/access_id/'); ?>', $("[name=access_id]").serialize(), function(data) {
				$('[name=item]').html(data);
			});
		});
		
		$("[name=title_search]").click( function(){
			$.post('<?php echo site_url('staff/jquery/getItemDetailsForReserveLoan/title/'); ?>', $("[name=title]").serialize(), function(data) {
				$('[name=item]').html(data);
			});
		}); 
});
</script>